package com.tao.xitong.util;



import com.tao.xitong.entity.User;

import java.util.Objects;

import static com.tao.xitong.common.Constants.ROLE_ADMIN_NUM;
import static com.tao.xitong.common.Constants.ROLE_READER_NUM;


public class RoleUtil {

    public static boolean isAdmin(User user) {
        return Objects.equals(user.getRole(), ROLE_ADMIN_NUM);
    }

    public static boolean isReader(User user) {
        return Objects.equals(user.getRole(), ROLE_READER_NUM);
    }

}
